package com.ruoyi.common.config.websockert;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;

/**
 * @author Fql18
 * @version 1.0
 * @date 2025-08-19 22:53
 * @description
 */
@Configuration
@EnableWebSocket
public class WsConfig implements WebSocketConfigurer {
	@Override
	public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
		registry.addHandler(new ChatWsHandler(), "/wss")
			.setAllowedOrigins("*");   // 如上线请改为具体域名
	}
}
